package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;
@Getter
@AllArgsConstructor
public enum StsnEnum {
	/**
	 * 编码生成规则
	 */
	PO("PO","采购单"),
	IR("IR","备货单"),
	PRO("PRO","采购退货单"),
	PA("PA","采购协议价单"),
	SO("SO","销售订单"),
	RO("RO","收货单"),
	SRO("SRO","客户退货单"),
	UO("UO","现场采购单"),
	FS("FS","费用单"),
	FC("FC","补差单"),
	SB("SB","供应商对账单"),
	SI("SI","供应商发票单"),
	AP("AP","预付款单"),
	PY("PY","付款单"),
	CB("CB","客户对账单"),
	CI("CI","客户发票单"),
	AR("AR","预收款"),
	RE("RE","收款单"),
	LA("LA","差异单"),
	CA("CA","客户协议报价单"),
	DO("DO","发货单号"),
	II("II","入库单号"),
	IO("IO","出库单号"),
	IS("IS","盘点单号"),
	PL("PL","报损报溢单号"),
	STO("STO","调拨单");


	/**
	 * 类型
	 */
	private String code;

	/**
	 * 描述
	 */
	private String name;

	public static StsnEnum get(String code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (StsnEnum stsnEnum : StsnEnum.values()){
			if (code.equals(stsnEnum.code))  return stsnEnum;
		}
		return null;
	}
}
